;Assembler header file for Gadget
;written by DefMod (Dec 31 2005) on Sat Dec 31 14:07:19 2005
;Jonathan Coxhead, jonathan@doves.demon.co.uk, 21 Sept 1995

        [       :LNOT: :DEF: Gadget_Hdr
        GBLS    Gadget_Hdr

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET oslib/Types.Hdr"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_Toolbox
        GBLS    Get_Toolbox
        ]
        [       :LNOT: :DEF: Toolbox_Hdr
Get_Toolbox                     SETS    "GET oslib/Toolbox.Hdr"
        |
Get_Toolbox                     SETS    ""
        ]
        $Get_Toolbox

;Symbols for constants
Gadget_Faded                    *       &80000000
Gadget_AtBack                   *       &40000000
Gadget_NoHandler                *       &0
Gadget_DefaultHandler           *       &1
Gadget_PrivateHandler           *       &2
Gadget_FeatureAddShift          *       0
Gadget_FeatureAdd               *       &3
Gadget_FeatureRemoveShift       *       2
Gadget_FeatureRemove            *       &C
Gadget_FeaturePostAddShift      *       4
Gadget_FeaturePostAdd           *       &30
Gadget_FeatureMethodShift       *       6
Gadget_FeatureMethod            *       &C0
Gadget_FeatureClickShift        *       10
Gadget_FeatureClick             *       &C00
Gadget_FeaturePlotShift         *       16
Gadget_FeaturePlot              *       &30000
Gadget_FeatureSetFocusShift     *       18
Gadget_FeatureSetFocus          *       &C0000
Gadget_FeatureMoveShift         *       20
Gadget_FeatureMove              *       &300000
Gadget_FeatureFadeShift         *       22
Gadget_FeatureFade              *       &C00000

;Symbols for structure offsets and sizes
                                ^       0
                                #       Bits
Gadget_Flags                    *       @

                                ^       0
Gadget_Object_flags             #       Gadget_Flags
Gadget_Object_class_no_and_size #       Bits
Gadget_Object_bbox              #       OS_Box
Gadget_Object_cmp               #       Toolbox_C
Gadget_Object_help_message      #       Toolbox_MsgReference
Gadget_Object_help_limit        #       Int
Gadget_Object_gadget            #       Int
Gadget_Object                   *       @
        
        MACRO
$label                          Gadget_Object_MEMBERS
$label._flags                   #       Gadget_Flags
$label._class_no_and_size       #       Bits
$label._bbox                    #       OS_Box
$label._cmp                     #       Toolbox_C
$label._help_message            #       Toolbox_MsgReference
$label._help_limit              #       Int
        MEND
        
                                ^       0
Gadget_ObjectBase               Gadget_Object_MEMBERS
Gadget_ObjectBase               *       @

                                ^       0
                                #       Bits
Gadget_Feature                  *       @

                                ^       0
Gadget_Extension_type           #       Int
Gadget_Extension_valid_flags    #       Gadget_Flags
Gadget_Extension_features       #       Gadget_Feature
Gadget_Extension                *       @

                                ^       0
Gadget_ExtensionList_gadget     #       Gadget_Extension
Gadget_ExtensionList            *       @


;Symbols for SWI's and SWI reason codes
Gadget_GetFlags                 *       &40
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &40
   ;  R3 = gadget (Toolbox_C)
   ;Exit
   ;  R0 = flags_out (Gadget_Flags)

Gadget_SetFlags                 *       &41
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &41
   ;  R3 = gadget (Toolbox_C)
   ;  R4 = flags_in (Gadget_Flags)

Gadget_SetHelpMessage           *       &42
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &42
   ;  R3 = gadget (Toolbox_C)
   ;  R4 -> help_message (String)

Gadget_GetHelpMessage           *       &43
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &43
   ;  R3 = gadget (Toolbox_C)
   ;  R4 = help_message (pointer to String)
   ;  R5 = size (Int)
   ;Exit
   ;  R5 = used (Int)

Gadget_GetIconList              *       &44
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &44
   ;  R3 = gadget (Toolbox_C)
   ;  R4 = buffer (pointer to Wimp_I)
   ;  R5 = size (Int)
   ;Exit
   ;  R5 = used (Int)

Gadget_SetFocus                 *       &45
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &45
   ;  R3 = gadget (Toolbox_C)

Gadget_GetType                  *       &46
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &46
   ;  R3 = gadget (Toolbox_C)
   ;Exit
   ;  R0 = type (Int)

Gadget_MoveGadget               *       &47
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &47
   ;  R3 = gadget (Toolbox_C)
   ;  R4 -> bbox (OS_Box)

Gadget_GetBBox                  *       &48
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &48
   ;  R3 = gadget (Toolbox_C)
   ;  R4 = bbox (pointer to OS_Box)

        ]
        END
